package com.jellyfishumbrella.GL;

public abstract class ThreadLoop extends Thread {
	public String	name;
	public boolean	done		= false;
	public boolean	doProcess	= false;
	public long		sleepMillis	= 10;

	public ThreadLoop(String name){
		super();
		this.name = name;
		System.out.println("creating thread " + name);
	}
	
	public void run() {
		System.out.println("running thread " + name);
		while (!done) {
			if (doProcess) {
				process();
				doProcess = false;
			}

			try {
				sleep(sleepMillis);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}

		}
		System.out.println("stopping thread " + name);
	}

	public void process() {
	}// override me...
}
